package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhPartsQrcodeInstallMapper;
import com.ruoyi.zsyh.domain.ZsyhPartsQrcodeInstall;
import com.ruoyi.zsyh.service.IZsyhPartsQrcodeInstallService;
import com.ruoyi.common.core.text.Convert;

/**
 * 产品安装信息Service业务层处理
 * 
 * @author yuexl
 * @date 2022-01-13
 */
@Service
public class ZsyhPartsQrcodeInstallServiceImpl implements IZsyhPartsQrcodeInstallService 
{
    @Autowired
    private ZsyhPartsQrcodeInstallMapper zsyhPartsQrcodeInstallMapper;

    /**
     * 查询产品安装信息
     * 
     * @param id 产品安装信息ID
     * @return 产品安装信息
     */
    @Override
    public ZsyhPartsQrcodeInstall selectZsyhPartsQrcodeInstallById(String id)
    {
        return zsyhPartsQrcodeInstallMapper.selectZsyhPartsQrcodeInstallById(id);
    }

    /**
     * 查询产品安装信息列表
     * 
     * @param zsyhPartsQrcodeInstall 产品安装信息
     * @return 产品安装信息
     */
    @Override
    public List<ZsyhPartsQrcodeInstall> selectZsyhPartsQrcodeInstallList(ZsyhPartsQrcodeInstall zsyhPartsQrcodeInstall)
    {
        return zsyhPartsQrcodeInstallMapper.selectZsyhPartsQrcodeInstallList(zsyhPartsQrcodeInstall);
    }

    /**
     * 新增产品安装信息
     * 
     * @param zsyhPartsQrcodeInstall 产品安装信息
     * @return 结果
     */
    @Override
    public int insertZsyhPartsQrcodeInstall(ZsyhPartsQrcodeInstall zsyhPartsQrcodeInstall)
    {
        zsyhPartsQrcodeInstall.setCreateTime(DateUtils.getNowDate());
        return zsyhPartsQrcodeInstallMapper.insertZsyhPartsQrcodeInstall(zsyhPartsQrcodeInstall);
    }

    /**
     * 修改产品安装信息
     * 
     * @param zsyhPartsQrcodeInstall 产品安装信息
     * @return 结果
     */
    @Override
    public int updateZsyhPartsQrcodeInstall(ZsyhPartsQrcodeInstall zsyhPartsQrcodeInstall)
    {
        zsyhPartsQrcodeInstall.setUpdateTime(DateUtils.getNowDate());
        return zsyhPartsQrcodeInstallMapper.updateZsyhPartsQrcodeInstall(zsyhPartsQrcodeInstall);
    }

    /**
     * 删除产品安装信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPartsQrcodeInstallByIds(String ids)
    {
        return zsyhPartsQrcodeInstallMapper.deleteZsyhPartsQrcodeInstallByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除产品安装信息信息
     * 
     * @param id 产品安装信息ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPartsQrcodeInstallById(String id)
    {
        return zsyhPartsQrcodeInstallMapper.deleteZsyhPartsQrcodeInstallById(id);
    }

    @Override
    public ZsyhPartsQrcodeInstall selectZsyhPartsQrcodeInstallByQrcodeId(String qrcodeId) {
        return zsyhPartsQrcodeInstallMapper.selectZsyhPartsQrcodeInstallByQrcodeId(qrcodeId);
    }

    public List<ZsyhPartsQrcodeInstall>  getInstallNotApplyByRepairId(String repairId){
        return zsyhPartsQrcodeInstallMapper.getInstallNotApplyByRepairId(repairId);
    }
}
